/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"90CE2646-26BD-4351-AC6A-06F7818E7C6E",variableType:4}
 */
var fEstado = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"BEC61698-299A-47F9-B002-20077E302520"}
 */
var fRazonSocial = null;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"5299D20A-7475-41A6-8347-448974E71466",variableType:4}
 */
var fTipo = null;

/**
 * @type {Date}
 *
 * @properties={typeid:35,uuid:"4649EF52-BA67-4039-B092-2C1B30DA6C0F",variableType:93}
 */
var fFechaDesde = new Date();

/**
 * @type {Date}
 *
 * @properties={typeid:35,uuid:"1BB7CB50-56A0-4405-88C1-C2A9CB295B3E",variableType:93}
 */
var fFechaHasta = new Date();

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"E43D7E64-D2E1-463B-A2E9-446DB15B28D4"}
 */
function iraDtl(event) {
	/* 
	var $paquetes = recep_cabecera_to_paquetes_ind.getSize()
	
	if ($paquetes > 0)
	{
		forms.recepciones_paq_dtl.controller.loadRecords(recep_cabecera_id)
		globals.mostrarForm('recepciones_paq_dtl')
	}
	else
	{*/
		forms.recepciones_dtl_ind.controller.loadRecords(recep_cabecera_id)
		globals.mostrarForm('recepciones_dtl_ind')
	//}
	
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"1B3BF5EB-A2B6-4316-A29E-20EA54EC2669"}
 * @AllowToRunInFind
 */
function onShow(firstShow, event) {
	controller.find()
	recep_estado = 2
	controller.search()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"ED896E29-A1B8-487E-BEEF-FC298CFE2E4A"}
 */
function fechasNulas(event) {
	fFechaDesde = null
	fFechaHasta = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"63CB61A1-DB6F-40AE-A266-DEEC11D0758E"}
 */
function estadoNulo(event) {
	fEstado = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"7CAD5846-71F6-4555-96B6-1F643268D264"}
 */
function tipoNulo(event) {
	fTipo = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"DAB654FB-AFD5-47E7-925D-3879F0AAB883"}
 */
function razonSocialNula(event) {
	fRazonSocial = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"010DCB40-53F0-47C7-A1CD-9DAB33062CC4"}
 * @AllowToRunInFind
 */
function buscar(event) {
	controller.find()
	
	razon_social 	= '%' + fRazonSocial + '%'
	tipo 			= fTipo
	recep_estado 	= fEstado
	fecha 			= '#' + utils.dateFormat(fFechaDesde,'dd-MM-yyyy') + '...' + utils.dateFormat(fFechaHasta,'dd-MM-yyyy') +'|dd-MM-yyyy'
	
	controller.search()
}
